/*
 * Conversion.java
 *
 * Created on April 10, 2007, 11:39 AM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package edu.byu.isys413.jjenkins.data;

/**
 * The class is the business object for a conversion, it creates attibutes, methods,
 * and functionallity pertaining to a conversion.
 *
 * @author      Intex2Week
 * @version     1.0
 */
public class Conversion extends RevenueSourceBO {

    private double quantity = 0;
    private String description = null;
    private String externalID = null;
    /**
     * transaction line
     */
    private TransactionLineBO line = null;
    
    /**
     * Creates a new instance of Conversion
     * @param guid 
     */
    public Conversion(String guid)
    
   {
        super.setId (guid);
    }

    /**
     * 
     * This method returns the quantity
     * @return quantity for the conversion
     */
    public double getQuantity ()
    {
        return quantity;
    }
    /**
     * sets the quantity of the conversion service
     * @param quantity
     */
    public void setQuantity (int quantity)
    {
        this.quantity = quantity;
    }

    /**
     * description of the conversion service
     * @return description
     */
    public String getDescription ()
    {
        return description;
    }

    /**
     * sets the description
     * @param description 
     */
    public void setDescription (String description)
    {
        this.description = description;
    }

    /**
     * This method returns the external ID
     * @return externalID
     */
    public String getExternalID ()
    {
        return externalID;
    }

    /**
     * sets the external ID
     * @param externalID 
     */
    public void setExternalID (String externalID)
    {
        this.externalID = externalID;
    }
    
    /**
     * This method sets the transaction line for the conversion
     * @param line line transaciton line of conversion
     */
    public void setLine(TransactionLineBO line) {
        this.line = line;
    }
    
    /**
     * This method calculates the price of the conversion
     * @return price
     */
    public double calcPrice(){
        return getPrice();
        
    }
    /**
     * the method creates the description of the conversion
     * @return description
     */
     public String createDescription(){
        setDescription(getType() + "             ConversionID:"+getExternalID()+"      Number to Convert:  " + getQuantity() + " Price" + getPrice());
        return getDescription();
        
    }
 
    
    
   
    
}
